#ifndef VIDEOPLAYERDIALOG_H
#define VIDEOPLAYERDIALOG_H

#include "popupdialog.h"
#include "touchbutton.h"
#ifdef Q_OS_ANDROID
#include <QVideoWidget>
#include <QMediaPlayer>
#else
#include <QWebEngineView>
#endif
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>

class VideoPlayerDialog : public PopupDialog
{
    Q_OBJECT
public:
    explicit VideoPlayerDialog(const QString& videoPath, QWidget* parent = nullptr);
    ~VideoPlayerDialog();


protected:
    void keyPressEvent(QKeyEvent* event) override;

private slots:
    void onLoadFinished(bool ok);

private:
    TouchButton* m_closeButton;
#ifdef Q_OS_ANDROID
    QVideoWidget* m_videoWidget;
    QMediaPlayer* m_mediaPlayer;
#else
    QWebEngineView* m_webView;
#endif
};

#endif // VIDEOPLAYERDIALOG_H 
